package com.effectivsocial.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.envers.Audited;

@Entity
@Table(name = "t_lov")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "lov_type", discriminatorType = DiscriminatorType.STRING)
@Audited
@EqualsAndHashCode(exclude={"name", "type"})
@ToString
public class Lov implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@Getter @Setter
	@Id
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid2")
	@Column(name = "id", updatable = false, nullable = false, unique = true)
	private String id;
	
	@Getter @Setter
	@Column(name = "name", length = 50)
	private String name;
	
	@Getter @Setter
	@Column(name = "lov_type", length = 50, insertable=false, updatable = false)
	private String type;
	
	
}
